<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<jsp:include page="/WEB-INF/jsps/front/jspCommon/jsAndCssCommon.jsp" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jqPlugins/jquery.pstrength-min.1.2.js"></script>
		<script type="text/javascript">
            
            $("document").ready(function(){       
			      $("#loginpassword").pstrength();
			});
            
            function checkLoginName(loginName){
            	if("" != loginName){
            		$.ajax({
	            		type:"post",
	            		dataType:"json",
	            		async:false,//同步请求将锁住浏览器，用户其它操作必须等待请求完成才可以执行
	            		url:"${pageContext.request.contextPath}/user/judge/ajax/loginName",
	            		data:{
	            			loginName:loginName
	            		},
	            		success:function(jsonData){
	            			if(jsonData.msg == "true"){
	            				alert("已经存在相同的登录名了，请重新输入");
	            				$("#loginname").val("");
	            			}
	            		}
	            	});
            	}
            }
            
		</script>
		<title>用户注册</title>
	</head>
	<body>
		
		<form id="userModel" action="${pageContext.request.contextPath}/user/register/save" method="post">
		<table align="center">
			<tr>
				<td>
					登录名：
				</td>
				<td>
					<input name="loginname" id="loginname" onblur="javascript:checkLoginName(this.value);" value="${userModel.loginname}" />
				</td>
			</tr>
			<tr>
				<td>
					登录密码：
				</td>
				<td>
					<input name="loginpassword" id="loginpassword" maxlength="18"/>
				</td>
			</tr>
			<tr>
				<td>
					密码确认：
				</td>
				<td>
					<input name="password" id="passwordConfirm" maxlength="18" />
				</td>
			</tr>
			<tr>
				<td>
					验证码：
				</td>
				<td>
					<input name="imageNO" id="imageNO" /><img  title="看不清?点击换一张" src="${pageContext.request.contextPath}/jcaptcha" id="safecode" onclick="this.src='${pageContext.request.contextPath}/jcaptcha?date='+new Date().getTime()" width="48" height="25" />
				</td>
			</tr>
			<tr>
				<td>
					<input type="submit" value="提交" />
				</td>
				<td>
					<input type="reset" value="重置" />
				</td>
			</tr>
		</table>
		</form>
	</body>
</html>